import java.io.*;

public class Main {

	public static void main(String[] args) {

		String array[] = null;
		User user = new User();

	//Cast exception
		try {
			System.out.println((SuperUser) user);
		} catch (Exception e) {
			System.out.println("Cast exception: " + e);
		}

		//Null exception
		try {
			Integer test = array.length;
		} catch (Exception e) {
			System.out.println("Null exception: " + e);
		}

		//Stack overflow exception
		try {
			test();
			
		} catch(StackOverflowError t) {
            System.out.println("Caught "+t);
            t.printStackTrace();
        
			System.out.println("Overflow " + t);
		}

		// IO exception
		try {

			BufferedReader file = new BufferedReader(new FileReader(
					"myFile.txt"));

			file.close();

		} catch (Exception e) {
			System.out.println("File not found Ex: " + e);

		}

	}

	public static void test() {
		test1();
	}

	public static void test1() {
		test();

	}

}
